<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE DeriveDataTypeable #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE DeriveGeneric #-}</span><span>
</span><span id="line-3"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Types.AbiDependency</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-6"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Parsec.html"><span class="hs-identifier">Distribution.Parsec</span></a></span><span>
</span><span id="line-9"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Pretty.html"><span class="hs-identifier">Distribution.Pretty</span></a></span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Compat.CharParsing.html"><span class="hs-identifier">Distribution.Compat.CharParsing</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">P</span></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Package.html"><span class="hs-identifier">Distribution.Package</span></a></span><span>            </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Package</span></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../pretty/src/Text.PrettyPrint.html#"><span class="hs-identifier">Text.PrettyPrint</span></a></span><span>                </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Disp</span></span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-comment">-- | An ABI dependency is a dependency on a library which also</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- records the ABI hash ('abiHash') of the library it depends</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- on.</span><span>
</span><span id="line-18"></span><span class="hs-comment">--</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- The primary utility of this is to enable an extra sanity when</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- GHC loads libraries: it can check if the dependency has a matching</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- ABI and if not, refuse to load this library.  This information</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- is critical if we are shadowing libraries; differences in the</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- ABI hash let us know what packages get shadowed by the new version</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- of a package.</span><span>
</span><span id="line-25"></span><span id="local-6989586621679660467"><span id="local-6989586621679660468"></span></span><span class="hs-keyword">data</span><span> </span><span id="AbiDependency"><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-var">AbiDependency</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="AbiDependency"><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-var">AbiDependency</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-26"></span><span>        </span><span id="depUnitId"><span class="annot"><span class="annottext">AbiDependency -&gt; UnitId
</span><a href="Distribution.Types.AbiDependency.html#depUnitId"><span class="hs-identifier hs-var hs-var">depUnitId</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">Package.UnitId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span id="depAbiHash"><span class="annot"><span class="annottext">AbiDependency -&gt; AbiHash
</span><a href="Distribution.Types.AbiDependency.html#depAbiHash"><span class="hs-identifier hs-var hs-var">depAbiHash</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.AbiHash.html#AbiHash"><span class="hs-identifier hs-type">Package.AbiHash</span></a></span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-29"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679660456"><span id="local-6989586621679660462"><span class="annot"><span class="annottext">AbiDependency -&gt; AbiDependency -&gt; Bool
(AbiDependency -&gt; AbiDependency -&gt; Bool)
-&gt; (AbiDependency -&gt; AbiDependency -&gt; Bool) -&gt; Eq AbiDependency
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: AbiDependency -&gt; AbiDependency -&gt; Bool
$c/= :: AbiDependency -&gt; AbiDependency -&gt; Bool
== :: AbiDependency -&gt; AbiDependency -&gt; Bool
$c== :: AbiDependency -&gt; AbiDependency -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(forall x. AbiDependency -&gt; Rep AbiDependency x)
-&gt; (forall x. Rep AbiDependency x -&gt; AbiDependency)
-&gt; Generic AbiDependency
forall x. Rep AbiDependency x -&gt; AbiDependency
forall x. AbiDependency -&gt; Rep AbiDependency x
forall a.
(forall x. a -&gt; Rep a x) -&gt; (forall x. Rep a x -&gt; a) -&gt; Generic a
$cto :: forall x. Rep AbiDependency x -&gt; AbiDependency
$cfrom :: forall x. AbiDependency -&gt; Rep AbiDependency x
</span><a href="../../base/src/GHC.Generics.html#Generic"><span class="hs-identifier hs-var hs-var hs-var hs-var">Generic</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679660431"><span id="local-6989586621679660445"><span id="local-6989586621679660448"><span id="local-6989586621679660450"><span class="annot"><span class="annottext">ReadPrec [AbiDependency]
ReadPrec AbiDependency
Int -&gt; ReadS AbiDependency
ReadS [AbiDependency]
(Int -&gt; ReadS AbiDependency)
-&gt; ReadS [AbiDependency]
-&gt; ReadPrec AbiDependency
-&gt; ReadPrec [AbiDependency]
-&gt; Read AbiDependency
forall a.
(Int -&gt; ReadS a)
-&gt; ReadS [a] -&gt; ReadPrec a -&gt; ReadPrec [a] -&gt; Read a
readListPrec :: ReadPrec [AbiDependency]
$creadListPrec :: ReadPrec [AbiDependency]
readPrec :: ReadPrec AbiDependency
$creadPrec :: ReadPrec AbiDependency
readList :: ReadS [AbiDependency]
$creadList :: ReadS [AbiDependency]
readsPrec :: Int -&gt; ReadS AbiDependency
$creadsPrec :: Int -&gt; ReadS AbiDependency
</span><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Read</span></a></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679660417"><span id="local-6989586621679660419"><span id="local-6989586621679660427"><span class="annot"><span class="annottext">Int -&gt; AbiDependency -&gt; ShowS
[AbiDependency] -&gt; ShowS
AbiDependency -&gt; String
(Int -&gt; AbiDependency -&gt; ShowS)
-&gt; (AbiDependency -&gt; String)
-&gt; ([AbiDependency] -&gt; ShowS)
-&gt; Show AbiDependency
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [AbiDependency] -&gt; ShowS
$cshowList :: [AbiDependency] -&gt; ShowS
show :: AbiDependency -&gt; String
$cshow :: AbiDependency -&gt; String
showsPrec :: Int -&gt; AbiDependency -&gt; ShowS
$cshowsPrec :: Int -&gt; AbiDependency -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679660413"><span class="annot"><a href="Distribution.Pretty.html#Pretty"><span class="hs-identifier hs-type">Pretty</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-type">AbiDependency</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-32"></span><span>    </span><span id="local-6989586621679660407"><span class="annot"><span class="annottext">pretty :: AbiDependency -&gt; Doc
</span><a href="Distribution.Pretty.html#pretty"><span class="hs-identifier hs-var hs-var hs-var hs-var">pretty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-type">AbiDependency</span></a></span><span> </span><span id="local-6989586621679660405"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679660405"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span id="local-6989586621679660404"><span class="annot"><span class="annottext">AbiHash
</span><a href="#local-6989586621679660404"><span class="hs-identifier hs-var">abi</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><span class="annottext">UnitId -&gt; Doc
forall a. Pretty a =&gt; a -&gt; Doc
</span><a href="Distribution.Pretty.html#pretty"><span class="hs-identifier hs-var">pretty</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679660405"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Distribution.Compat.Prelude.html#%3C%3C%3E%3E"><span class="hs-operator hs-var">&lt;&lt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">Disp.char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'='</span></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Distribution.Compat.Prelude.html#%3C%3C%3E%3E"><span class="hs-operator hs-var">&lt;&lt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">AbiHash -&gt; Doc
forall a. Pretty a =&gt; a -&gt; Doc
</span><a href="Distribution.Pretty.html#pretty"><span class="hs-identifier hs-var">pretty</span></a></span><span> </span><span class="annot"><span class="annottext">AbiHash
</span><a href="#local-6989586621679660404"><span class="hs-identifier hs-var">abi</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">instance</span><span>  </span><span class="annot"><a href="Distribution.Parsec.html#Parsec"><span class="hs-identifier hs-type">Parsec</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-type">AbiDependency</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-36"></span><span>    </span><span id="local-6989586621679660380"><span class="annot"><span class="annottext">parsec :: forall (m :: * -&gt; *). CabalParsing m =&gt; m AbiDependency
</span><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier hs-var hs-var hs-var hs-var">parsec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-37"></span><span>        </span><span id="local-6989586621679660378"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679660378"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m UnitId
forall a (m :: * -&gt; *). (Parsec a, CabalParsing m) =&gt; m a
</span><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier hs-var">parsec</span></a></span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Char -&gt; m Char
forall (m :: * -&gt; *). CharParsing m =&gt; Char -&gt; m Char
</span><a href="Distribution.Compat.CharParsing.html#char"><span class="hs-identifier hs-var">P.char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'='</span></span><span>
</span><span id="line-39"></span><span>        </span><span id="local-6989586621679660376"><span class="annot"><span class="annottext">AbiHash
</span><a href="#local-6989586621679660376"><span class="hs-identifier hs-var">abi</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m AbiHash
forall a (m :: * -&gt; *). (Parsec a, CabalParsing m) =&gt; m a
</span><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier hs-var">parsec</span></a></span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><span class="annottext">AbiDependency -&gt; m AbiDependency
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; AbiHash -&gt; AbiDependency
</span><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-var">AbiDependency</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679660378"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">AbiHash
</span><a href="#local-6989586621679660376"><span class="hs-identifier hs-var">abi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679660370"><span id="local-6989586621679660372"><span id="local-6989586621679660374"><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-type">AbiDependency</span></a></span></span></span></span><span>
</span><span id="line-43"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679660363"><span id="local-6989586621679660365"><span class="annot"><a href="Distribution.Utils.Structured.html#Structured"><span class="hs-identifier hs-type">Structured</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-type">AbiDependency</span></a></span></span></span><span>
</span><span id="line-44"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier hs-type">AbiDependency</span></a></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679660342"><span class="annot"><span class="annottext">rnf :: AbiDependency -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var hs-var hs-var hs-var">rnf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AbiDependency -&gt; ()
forall a. (Generic a, GNFData (Rep a)) =&gt; a -&gt; ()
</span><a href="Distribution.Compat.Prelude.html#genericRnf"><span class="hs-identifier hs-var">genericRnf</span></a></span><span>
</span><span id="line-45"></span></pre></body></html>